<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>{:lang('USER_INDEXADMIN_INDEX')}</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('user/adminIndex/index')}">
		派单主持人：
        <select class="form-control" name="ishost">
            <option value="">全部</option>
                <option value="1" <if condition="input('request.ishost') neq '' && input('request.ishost') eq 1">selected</if>>是</option>
                <option value="0" <if condition="input('request.ishost') neq '' && input('request.ishost') eq 0">selected</if>>否</option>
        </select>	
		
		直播超管：
        <select class="form-control" name="issuper">
            <option value="">全部</option>
                <option value="1" <if condition="input('request.issuper') neq '' && input('request.issuper') eq 1">selected</if>>是</option>
                <option value="0" <if condition="input('request.issuper') neq '' && input('request.issuper') eq 0">selected</if>>否</option>
        </select>	
		
		
        用户ID：
        <input class="form-control" type="text" name="uid" style="width: 200px;" value="{:input('request.uid')}"
               placeholder="请输入用户ID">
        关键字：
        <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}"
               placeholder="用户名/昵称">
			   
		   
		
		<!-- 设备来源：
        <select class="form-control" name="source">
            <option value="">全部</option>
                <option value="0" <if condition="input('request.source') neq '' && input('request.source') eq '0'">selected</if>>PC</option>
                <option value="1" <if condition="input('request.source') neq '' && input('request.source') eq '1'">selected</if>>安卓APP</option>
                <option value="2" <if condition="input('request.source') neq '' && input('request.source') eq '2'">selected</if>>苹果APP</option>
                <option value="3" <if condition="input('request.source') neq '' && input('request.source') eq '3'">selected</if>>小程序</option>
        </select>-->
        提交时间：
        <input class="form-control js-bootstrap-date" name="start_time" id="start_time" value="{:input('request.start_time')}" aria-invalid="false" style="width: 110px;"> - 
        <input class="form-control js-bootstrap-date" name="end_time" id="end_time" value="{:input('request.end_time')}" aria-invalid="false" style="width: 110px;">
            	   
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('user/adminIndex/index')}">清空</a>
		<br>
        <br>
		用户数：{$nums}  (根据条件统计)
    </form>
    <form method="post" class="js-ajax-form">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th>ID</th>
                <th>{:lang('USERNAME')}</th>
                <th>{:lang('NICENAME')}</th>
                <th>{:lang('AVATAR')}</th>
                <!-- <th>{:lang('EMAIL')}</th> -->
                <th>余额</th>
                <th>累计消费</th>
                <th>订单收益余额</th>
                <th>订单收益总额</th>
                <th>礼物收益余额</th>
                <th>礼物收益总额</th>
                <th>{:lang('REGISTRATION_TIME')}</th>
                <th>{:lang('LAST_LOGIN_TIME')}</th>
                <th>{:lang('LAST_LOGIN_IP')}</th>
                <th>{:lang('STATUS')}</th>
                <th>{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <php>
                $user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));
            </php>
            <foreach name="list" item="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo['user_login']?$vo['user_login']:($vo['mobile']?$vo['mobile']:lang('THIRD_PARTY_USER'))}
                    </td>
                    <td>{$vo['user_nickname']?$vo['user_nickname']:lang('NOT_FILLED')}</td>
                    <td><img width="25" height="25" src="{:get_upload_path($vo['avatar'])}"/></td>
                    <!-- <td>{$vo.user_email}</td> -->
                    <td>{$vo.coin}</td>
                    <td>{$vo.consumption}</td>
                    <td>{$vo.votes}</td>
                    <td>{$vo.votestotal}</td>
					<td>{$vo.votes_gift}</td>
                    <td>{$vo.votes_gifttotal}</td>
                    <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                    <td>{:date('Y-m-d H:i:s',$vo['last_login_time'])}</td>
                    <td>{$vo.last_login_ip}</td>
                    <td>
                        <switch name="vo.user_status">
                            <case value="0">
                                <span class="label label-danger">{$user_statuses[$vo['user_status']]}</span>
                            </case>
                            <case value="1">
                                <span class="label label-success">{$user_statuses[$vo['user_status']]}</span>
                            </case>
                            <case value="2">
                                <span class="label label-warning">{$user_statuses[$vo['user_status']]}</span>
                            </case>
                        </switch>
                    </td>
                    <td>
                        <neq name="vo.id" value="1">
                            <empty name="vo.user_status">
                                <a class="btn btn-xs btn-success js-ajax-dialog-btn"
                                   href="{:url('adminIndex/cancelban',array('id'=>$vo['id']))}"
                                   data-msg="{:lang('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:lang('ACTIVATE_USER')}</a>
                                <else/>
                                <a class="btn btn-xs btn-warning js-ajax-dialog-btn"
                                   href="{:url('adminIndex/ban',array('id'=>$vo['id']))}"
                                   data-msg="{:lang('BLOCK_USER_CONFIRM_MESSAGE')}">{:lang('BLOCK_USER')}</a>
                            </empty>
                            <else/>
                            <a class="btn btn-xs btn-warning disabled">{:lang('BLOCK_USER')}</a>
                        </neq>
                         <if condition="$vo.isrecommend eq '1'">
							<a class="btn btn-xs btn-info js-ajax-dialog-btn"
								   href="{:url('adminIndex/setrecommend',array('id'=>$vo['id'],'isrecommend'=>0))}">取消推荐</a>
						<else/>
							<a class="btn btn-xs btn-info js-ajax-dialog-btn"
								   href="{:url('adminIndex/setrecommend',array('id'=>$vo['id'],'isrecommend'=>1))}">推荐</a>
						</if>
                        <if condition="$vo['ishost'] eq 1">
                            <a class="btn btn-xs btn-primary js-ajax-dialog-btn" href="{:url('adminIndex/setHost',array('id'=>$vo['id'],'ishost'=>0))}" >取消派单主持人</a>
                        <else/>
                            <a class="btn btn-xs btn-primary js-ajax-dialog-btn" href="{:url('adminIndex/setHost',array('id'=>$vo['id'],'ishost'=>1))}">设为派单主持人</a>
                        </if>
						
						<if condition="$vo.issuper eq '1'">
							<a class="btn btn-xs btn-info js-ajax-dialog-btn"
								   href="{:url('adminIndex/setsuper',array('id'=>$vo['id'],'issuper'=>0))}">取消直播超管</a>
						<else/>
							<a class="btn btn-xs btn-info js-ajax-dialog-btn"
								   href="{:url('adminIndex/setsuper',array('id'=>$vo['id'],'issuper'=>1))}">设为直播超管</a>
						</if>
                        <a class="btn btn-xs btn-info" href='{:url("adminIndex/labelindex",array("id"=>$vo["id"]))}'>标签管理</a>
						
                        <a class="btn btn-xs btn-primary" href='{:url("adminIndex/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-danger js-ajax-dialog-btn"
                                   href="{:url('adminIndex/del',array('id'=>$vo['id']))}"
                                   data-msg="您确定要删除此用户么？">{:lang('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>